<template>
	<view class="main">
		<delVue :Visible="Visible" @isModal="isModal" :oneText="oneText" @goStay="goStay" :twoText="twoText"
			:threeText="threeText" :fourText="fourText" />
			
		<view class="title">
			<alltitleVue :title="title" :url="url" />
		</view>

		<view class="box">
			<view class="item" v-for="(item,index) in list" :key="index" @click="goskip(item,index)">
				<view class="">
					{{item.title}}
				</view>
				<image class="right-img" :src="right" mode=""></image>
				
			</view>
		</view>
		<view class="" @click="logout">
			<allBtnVue :btnText="btnText" />
		</view>

	</view>

</template>

<script>
	
	import {
		toast,
		getStore,
		setStore,
		removeStore
	} from "@/utils/index";
	import config from "../../utils/config";
	import {

		logout,


	} from '../../service/api.js';
	import allBtnVue from '../../components/allBtn.vue';
	import delVue from '../../components/del.vue'
	export default {

		data() {
			return {
				right: config.ossHost + "2025/01/09/ee1bcb20aa0b4ae5a14ad5dce09c3ba6.png",
				title: "设置",
				oneText: "再想想",
				twoText: "确定",
				threeText: "确定退出登录吗？",
				fourText: "提示",
				
				
				
				Visible: false,
				list: [{
						title: "服务协议",
						package: 'policy'
					},
					{
						title: "关于我们",
						package: 'aboutUs'
					},
					// {
					// 	title: "账号注销",
					// 	package: ''
					// },
					// {
					// 	title: "版本更新",
					// 	package: ''
					// }
				],
				btnText: "退出登录"
			}
		},
		components: {
			allBtnVue,
			delVue
		},
		onLoad() {

		},
		methods: {
			goskip(item){
				uni.navigateTo({
					url:`/My/${item.package}`
				})
				// this.isshow=true;
			},
			isModal(item){
				this.Visible=item
			},
			async goStay(item) {
				let res = await logout();
				if (res.code == 200) {
					removeStore("token");
					removeStore("info");
					removeStore("openid");
					toast(res.msg);
					this.Visible=item
					uni.switchTab({
						url: '/pages/index/index' // TabBar 页面路径
					});
				}
			},
			
			logout() {

				this.Visible = true;

			},
		},
	}
</script>

<style lang="scss" scoped>
	.title {
		background: #FFFFFF;
	}

	.box {
		padding: 24rpx;

		.item {
			margin-bottom: 24rpx;
			width: 654rpx;
			padding: 24rpx;



			background: #FFFFFF;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			display: flex;
			justify-content: space-between;
		}
	}
</style>